<template>
  <div> <!--面包屑导航-->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>角色列表</el-breadcrumb-item>
    </el-breadcrumb>
        <!--卡片区-->
    <el-card>
      <el-row>
        <el-button type="primary">添加用户</el-button>
      </el-row>
    </el-card>
        <!--数据列表区-->
    <el-table :data="rolesList">
      <el-table-column type="index"></el-table-column>
      <el-table-column label="角色名称" prop="roleName"></el-table-column>
      <el-table-column label="技术负责人" prop="roleDesc"></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
        
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    name: "Roles",
    data() {
      return {
        //角色列表数据
        rolesList: []
      }
    },
    created() {
      this.getRolesList()
    },
    methods: {
      async getRolesList() {
        //从后来接收数据
        const {data: res} = await this.$http.get('roles')
        if (res.meta.status !== 200) {
          return this.$message.error('获取角色信息失败')
        }
        this.rolesList = res.data
        console.log(this.rolesList)
      }
    }
  }
</script>

<style scoped>

</style>
